package com.llbnk.springcoding.dao;

import com.llbnk.springcoding.migrate.MigrateDispatch;
import com.llbnk.springcoding.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserDaoImpl  implements UserDao {

    @Autowired
    private MigrateDispatch<User> migrateDispatch;

    @Override
    public void insert(User user) {
        migrateDispatch.migrateAdd(user,"user");
    }

    @Override
    public User selectByUserId(Long userId) {
        return migrateDispatch.migrateSelect("selectByUserId","user",userId);
    }
}
